<?php
	echo "<a href=\"index.php\">返回主页</a>";
	echo "<p align='center'><a  href=\"add.php\">添加考试</a></p>";
	echo "<table border='1' align='center'>";
	echo '<tr bgcolor="#cccccc">';
	echo "<th>考试班级</th><th>考试科目</th><th>考试时间</th><th>考试地点</th><th>监考老师</th><th>操作</th>";
	try{
		$db =new pdo("mysql:host=localhost;dbname=db_database10;charset=utf8","root","");
	}
	catch(Exception $exc){
		echo $exc->getMessage();
	}
	$result = $db->query('select * from exam');
	while($results= $result->fetch(PDO::FETCH_ASSOC)){
		echo "<tr><td>".$results['class']."</td>";
		echo "<td>".$results['course']."</td>";
		echo "<td>".$results['time']."</td>";
		echo "<td>".$results['room']."</td>";
		echo "<td>".$results['teacher']."</td>";
		echo "<td><a href=\"edit.php?ID=".$results['id']."\" >编辑</a>  <a href=\"del.php?ID=".$results['id']."\">删除</a></td></tr>";
	}
?>